package com.molichuxing.services.infrastructure.service;

import java.util.List;
import java.util.Map;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.dto.TabDto;
import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.request.create.OfflineCreateDto;
import com.molichuxing.services.infrastructure.dto.request.modify.OfflineAuditModifyDto;
import com.molichuxing.services.infrastructure.dto.response.OfflineAuditDto;
import com.molichuxing.services.infrastructure.dto.response.OfflineDto;

/**
 * <p>
 * 线下支付
 * </p>
 *
 * @author zhaopenghui
 * @since 2019-08-21
 */
public interface OfflineService extends RootService {

    /**
     * 添加线下支付
     *
     * @param offlineCreateDto
     * @return
     * @throws Exception
     */
    public Integer createOffline(OfflineCreateDto offlineCreateDto) throws Exception;

    /**
     * 线下支付审核信息
     *
     * @param offlineId
     * @return
     * @throws Exception
     */
    public OfflineAuditDto getOfflineAudit(Integer offlineId) throws Exception;

    /**
     * 线下支付分页列表
     *
     * @param map      key:serialNumber String 流水编号
     *                 key:dealerId Integer 经销商id
     *                 key:auditStatus Integer 审核状态（0：未审核，1：审核通过，2：驳回）
     *                 key:payName String 付款方
     *                 key:repayType Integer 还款类型（1:经销商, 2:用户）
     *                 key:startApplyTime LocalDateTime 申请开始时间
     *                 key:endApplyTime LocalDateTime 申请结束时间
     * @param pageNum
     * @param pageSize
     * @return
     * @throws Exception
     */
    public Paged<OfflineDto> getOfflinePage(Map<String, Object> map, Integer pageNum, Integer pageSize) throws Exception;

    /**
     * 通过审核状态获取线下支付数量
     *
     * @return
     * @throws Exception
     */
    Map<Integer, Integer> getCountByAuditStatus(Integer dealerId) throws Exception;

    /**
     * 审核状态数量
     *
     * @param dealerId
     * @return
     * @throws Exception
     */
    public List<TabDto> getTabDto(Integer dealerId) throws Exception;

    /**
     * 获取线下支付信息
     *
     * @param offlineId
     * @return
     * @throws Exception
     */
    public OfflineDto getOffline(Integer offlineId) throws Exception;

    /**
     * 校验流水编号
     *
     * @param serialNumber
     * @return
     * @throws Exception
     */
    public Boolean getSerialNumberExists(String serialNumber) throws Exception;

    /**
     * 是否存在未审核的信息
     *
     * @param ids
     * @return
     * @throws Exception
     */
    public Boolean getUnAudit(List<Integer> ids) throws Exception;

    /**
     * 还款审核
     *
     * @param offlineAuditModifyDto
     * @return
     * @throws Exception
     */
    public Boolean modifyAuditStatus(OfflineAuditModifyDto offlineAuditModifyDto) throws Exception;

    /**
     * 获取数量
     *
     * @param repayType
     * @return
     */
    public Integer getOfflineCount(Integer repayType);

    /**
     * 通过流水号获取线下支付信息
     *
     * @param serialNumberList
     * @return
     */
    public Map<String, OfflineDto> getOfflineBySerialNumber(List<String> serialNumberList);

	/**
	 * 获取线下支付信息
	 *
	 * @param serialNumber
	 * @param auditStatusList
	 * @return
	 */
	public OfflineDto getOffline(String serialNumber,List<Integer> auditStatusList);

	/**
	 * 获取用户订单线下还款tab标签数据
	 *
	 * @return
	 * @throws Exception
	 */
	public List<TabDto> getMemberTabsStatistics() throws Exception;


    /**
     * 获取线下支付数量
     *
     * @param map
     * @return
     */
    public Integer getOfflineCount(Map<String, Object> map);

}
